﻿using ERP.Localization;
using System;
using System.Collections.Generic;
using System.Text;
using Volo.Abp.Features;
using Volo.Abp.Localization;
using Volo.Abp.Validation.StringValues;

namespace ERP.Features
{

    public static class ERPFeature
    {
        //默认功能
        public const string Default = "ERP.Default";
        public const string UserCount = Default + ".UserCount";
        public const string Flow = Default + ".Flow";
    }
    public class ERPFeatureDefinitionProvider : FeatureDefinitionProvider
    {
        public override void Define(IFeatureDefinitionContext context)
        {
            var group = context.AddGroup(ERPFeature.Default, L("Feature:Default"));
            group.AddFeature(ERPFeature.UserCount,displayName: L("Feature:UserCount"),  defaultValue: "20",valueType: new FreeTextStringValueType() );
            group.AddFeature(ERPFeature.Flow, displayName: L("Feature:Flow"), defaultValue: "false", valueType: new ToggleStringValueType() );
        }
        private static LocalizableString L(string name)
        {
            return LocalizableString.Create<ERPResource>(name);
        }
    }
}
